<?php

class usersActions extends sfActions
{
	/**
	 * Enter description here...
	 *
	 * @param sfWebRequest $request
	 */
	public function executeIndex($request)
	{
	}
	
	/**
	 * Enter description here...
	 *
	 * @param sfWebRequest $request
	 */
  public function executeAccountValidation($request)
  {
  	$this->user = Doctrine::getTable('sfGuardUser')->findOneByUserName($request->getParameter('username'));

  	if($request->getParameter('key') != $this->user->getValidationKey())
  	{
  		
  		return sfView::ERROR;
  	}
  	else
  	{
  		$this->key = $this->user->getValidationKey();
  		
  		$this->user->setValidationKey(null);
  		$this->user->setIsActive(1);
  		$this->user->save();
  		
  		$this->getUser()->signin($this->user, true);
  		
  		return sfView::SUCCESS;
  	}
  }
}
